import React, { Component } from 'react'
import store from '../../Redux/store'
import {asyncfuncaction,delayaction} from '../../Redux/asyn_reducer'


export default class AsynRequest extends Component {

  asyncclick = () => {
    store.dispatch(asyncfuncaction(3))
  }

  SendClick = () => {
    store.dispatch(delayaction(2,2000))
  }

  render() {
    return (
      <div>
        <h1>异步请求{store.getState()}</h1>
        <button onClick={this.asyncclick}>Redux异步请求</button>
        <button onClick={this.SendClick}>发送请求</button>
      </div>
    )
  }
}
